package cn.netjava.chapter13.TableConnector;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class Connector {
	private static final String DATABASE_NAME = "sky";
	
	private static String name= "root";
	
	private static String url= "jdbc:mysql://localhost:3306/"+DATABASE_NAME;
	
	private static String passWord = "123456";
	
	private static Connection con;
	
	private static PreparedStatement pstat1;
	
	static{
		try{
		
		java.lang.Class.forName("com.mysql.jdbc.Driver");
		
		con = DriverManager.getConnection(url,name,passWord);	
		
		}catch(Exception ep){
			ep.printStackTrace();
		}

	}
	public static Connection getConnection(){
		return con;
	}
	
	
	

}
